From: Florian Müllner Date: Tue, 23 Oct 2012 12:32:27 +0000 (+0200) Subject: calendar: Handle calendar-server errors X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5550 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a4e29e1244b097fc2bebc371e00d7af30537c376;p=gnome-shell.git calendar: Handle calendar-server errors The current code assumes that the GetEvents call will always receive, causing an exception in the error case. https://bugzilla.gnome.org/show_bug.cgi?id=686805 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 7ee01cf51..3a3e73c66 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -270,8 +270,9 @@ const DBusEventSource = new Lang.Class({ this._loadEvents(false); }, - _onEventsReceived: function([appointments]) { + _onEventsReceived: function(results, error) { let newEvents = []; + let appointments = results ? results[0] : null; if (appointments != null) { for (let n = 0; n < appointments.length; n++) { let a = appointments[n];